package InterfaceDemo4;
public class DeviceDemo {
    public static void main(String[] args) {
        Device printer = new Printer("惠普");
        Device smartBoard = new SmartBoard("希沃");
        NetworkDevice networkPrinter = new Printer("佳能");
        UsbDevice usbPrinter = new Printer("爱普生");

        DeviceManager.managePower(printer, true);
        DeviceManager.managePower(smartBoard, true);

        DeviceManager.manageNetworkConnection(networkPrinter);
        DeviceManager.manageNetworkConnection((NetworkDevice) smartBoard);

        DeviceManager.manageUsbConnection(usbPrinter);

        DeviceManager.managePower(printer, false);
        DeviceManager.managePower(smartBoard, false);
    }
}